<?php

/**
 * @author thihien
 * @copyright 2011
 */
require_once('includes/general.php');
if(!tep_db_checkDb()) die('khong ket noi dc csdl');
$sql='select * from video';
$kq=tep_db_query($sql);
$content='';
$content.='
    <div id="center">
        <div id="tt_sanpham">
            <div class="title"><h3>products</h3></div>';
        while($item=tep_db_fetch_array($kq)){
            $content.='
             
            <div id="sanpham">
                <div id="hinhanh1"><a href="?page=video&mavideo='.$item['id'].'&mode=detail"><img height="120"  src="admin/upload/'.$item['hinhanh'].'"/></a></div>
                <div id="tensp1">'.$item['tieude'].'</div>
                <div id="tensp1">'.$item['tenvideo'].'</div>
                <div><a href="?page=sanpham_khac&mavideo='.$item['id'].'&mode=detail">watch video...</a></div>
            </div>
                
                ';
                
        }
$content.='
        </div>
        <div id="phantrang"></div>
    </div> 
';
//chi tiet san pham
if(isset($_GET['mode']) && $_GET['mode']==detail){
$mavideo=$_GET['mavideo'];
$sql='select * from video where id='.$mavideo;
$kq=tep_db_query($sql);
$content='
    <div id="center">
        <div id="tt_sanpham">
            <div class="title"><h3>products</h3></div>';
        while($item=tep_db_fetch_array($kq)){
            $content.='
             
            <div id="sanpham">
                <div id="hinhanh1"><img height="200"  src="video/'.$item['tenvideo'].'"/></div>
            </div>
            <div id=noidung_ctsp>
                 <div id="tensp1">'.$item['tieude'].'</div>
                <div id="tensp1">'.$item['tenvideo'].'</div>
            </div>
                
                ';
                
        }
$content.='
        </div>
    </div> 
';
}
echo $content;
?>

